import java.util.Scanner;

public class Main {
    public static boolean Fun(int a){
        for (int i=2;i<a;i++){
            if (a%i==0){
                return false;
            }
        }
        return true;
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int x = sc.nextInt();
        for (int i=x/2;i>=2;i--){
            if (Fun(i)&&Fun(x-i)){
                System.out.println(i);
                System.out.println(x-i);
                return ;
            }
        }
    }
}
